/*
 * @Description: 路由
 * @Author: FreeDoM_BaT
 * @Date: 2025-07-15 20:45:31
 */
import { createRouter, createWebHistory } from "vue-router";
import { appRoutes } from "./routes";
import { NOT_FOUND_ROUTE } from "./routes/base";
import "nprogress/nprogress.css";
import createRouteGuard from "./guard";

const router = createRouter({
  history: createWebHistory("/"),
  routes: [
    {
      path: "/",
      meta: {
        title: "首页",
      },
      redirect: "/dashboard/index",
    },
    {
      path: "/login",
      name: "login",
      meta: {
        title: "登录",
      },
      component: () => import("@/views/login/index.vue"),
    },
    ...appRoutes,
    NOT_FOUND_ROUTE,
  ],
});

createRouteGuard(router);

export default router;
